Package distribution While at work I spotted a nice and simple challenge.
The job was to stock products in cargo units with a certain capability.
Since an order can have various batches, coming in sequence from the production, we usually make a list of the pieces of those batches distributed in each cargo to make sure nothing is lost during the process.
For example if we had this production sheet:
 _____________
|ord: xxx     |
|_____________|
| A | 30 pcs  |
| B | 38 pcs  |
| C | 12 pcs  |
 —————————————

and our cargo could contain 12 pieces we would make this list:
A | 12 12  6-
B | -6 12 12  8-
C | -4  8//

where x- indicates that x pieces will be stocked with -y pieces of the next line and z// indicates that after those z pieces there's a different order, thus nothing more we can add, and the last cargo is complete.
Task
In this challenge you have to take a production sheet and a cargo capacity and output the distributed list.
Specifications
Production sheet is taken in the form of a sequence of numbers representing the batches amounts.
You have to output just the distributed amounts, we don't care about the additional signs - // mentioned above.
Every batch must be distributed separately, so the output is a list of lists which you can represent in any reasonable format, just specify it and be consistent.
It's guarantee that:

each batch has at least one piece
cargo units can contain at least one piece
an order( input list ) has at least one batch

So you have to handle only positive integers( &gt;0 ).
input:
a list of numbers representing the production sheet and a number representing the cargo capacity, each positive integers, in any reasonable method / order.
output:
the distributed list in form of a list of lists of numbers in any convenient method.

No extraneous numbers can appear in the output.
Order of obtained lists must be preserved.

Test cases
 [30, 38, 12], 12 =&gt; [[12,12,6],[6,12,12,8],[4,8]]
 [1],1 =&gt; [[1]]
 [2],1 =&gt; [[1,1]]
 [1],2 =&gt; [[1]]
 [1,12,34],20 =&gt; [[1],[12],[7,20,7]]
 [5],1 =&gt; [[1,1,1,1,1]]
 [5],5 =&gt; [[5]]
 [300,120],84 =&gt; [[84,84,84,48],[36,84]]
 [1,2,3,4,5],6 =&gt; [[1],[2],[3],[4],[2,3]]
 [2,5,16,38,32,38,38,34,8,30,31,9,12],15 =&gt; [[2],[5],[8,8],[7,15,15,1],[14,15,3],[12,15,11],[4,15,15,4],[11,15,8],[7,1],[14,15,1],[14,15,2],[9],[4,8]]

Rules

Input/output can be given by any convenient method.
You can print it to STDOUT, return it as a function result or error message/s.
Either a full program or a function are acceptable.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Sandbox
J, 36 34 27 24 bytes
(]&lt;@(#/.~)/.[:I.#\&amp;:-)I.

Try it online!
-3 bytes thanks to Bubbler
Takes capacity as left arg and production sheet as right arg.
how
Use 12 f 30 38 12 as an example.

(...)I. A dyadic hook which expands the right arg into a mask with 30 0s, 38 1s, and 12 2s:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2


#\&amp;:- makes both arguments negative &amp;:-. The _12 on the left means &quot;chunks of size 12&quot; and #\ will count each:
 12 12 12 12 12 12 8


[:I. Use the same expansion trick we used before to expand each of those in place into a unique integer:
 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6


].../. Use the mask from step 1 to group the output of the last step into groups of size 30, 38, and 12:
  0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 
  2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5
  5 5 5 5 6 6 6 6 6 6 6 6


(#/.~)/. For each of those groups, self-group by value, returning a list of the number of items in each group:
  _________ 12 ________   ________ 12 _________   ___ 6 ___ 
 /                     \ /                     \ /         \
 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 

  ___ 6 ___   ________ 12 _________   ________ 12 _________   _____ 8 _____
 /         \ /                     \ /                     \ /             \
 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5

  _ 4 _   _____ 8 _____
 /     \ /             \
 5 5 5 5 6 6 6 6 6 6 6 6


Finally, box each of those results &lt;@ because J doesn't allow ragged arrays.