In the mid-eighteenth century when the play La Guerra is set, the post of "commissario di guerra" (or "commissaire des guerres" in French) was common in many European militaries, such as the Bourbon armies, and later, in Napoleon's armies too. Goldoni was presumably writing with the Venetian army in mindthe context of the War of the Spanish Succession, and although I cannot say for sure (thatso would be a job for a military historian)have had the Habsburg, I would imagine thatSavoy, and Bourbon armies in mind, in which the role and duties would beof this position were similar.
In essence, a commissario di guerracommissario di guerra was a combination of a general staff officer, paymaster, and athe chief quartermaster1, responsible for tasks such as "troop discipline, enforcement of military regulations, quantity and quality of the distributed supplies, repairs and fortification of the places, construction of the ovens [for baking bread CDS], lodging of the officers and soldiers, guard and conservation of food supplies (wheat, flour, oatmeal, medicines...), distribution at the end of each march, administration of the hospitals..."
These responsibilities gave ample opportunities for unscrupulous individual to enrich themselves. As they were responsible for providing supplies, with very little oversight, they could do the standard trick of buying cheaply and selling (to the army) at a profit, and of course, inflate profits further by adulterating the food to make it go further. Similarly they could buy sub-standard equipment and sell it to the army at inflated rates. This reddit thread recalls some infamous examples occurring in France prior to the Revolution "that the armies were being supplied with sub-standard goods, such as sabres made from tin instead of steel", and with boots soled with cardboard. If he happened to own land in the vicinity, a commissioner could also choose to billet troops on his property, so that he could pay himself compensation, as well as receiving the rent. Naturally as he was in charge of issuing their pay to the troops, there was the opportunity for more standard avenues of embezzlement too.
Basically, Goldoni was completely justified to say:
The gold consumed in the armies doesn't vanish into the ground; it flows into the hands of a few individuals, and the commissioners have the largest part of it.
as the commissioners were able to divert a reasonable proportion of the army's financing into their own pockets.
1 L'Escercito Borbonico dal 1789 al 1815, by Giancarlo Boeri, Pietro Crociani and Massimo Brandani.