Bulk Stock Update
This commit is contained in:
parent
7a451a046f
commit
9ec948c9e9
|
|
@ -11,7 +11,25 @@
|
||||||
.checkmark { width: 18px; height: 18px; border: 1px solid #bdc9c4; border-radius: 5px; display: grid; place-items: center; color: transparent; font-size: 11px; background: #fff; }
|
.checkmark { width: 18px; height: 18px; border: 1px solid #bdc9c4; border-radius: 5px; display: grid; place-items: center; color: transparent; font-size: 11px; background: #fff; }
|
||||||
.check-options input:checked + .checkmark { background: var(--green); border-color: var(--green); color: white; }
|
.check-options input:checked + .checkmark { background: var(--green); border-color: var(--green); color: white; }
|
||||||
.check-options input:focus + .checkmark { outline: 2px solid #b6d9ca; }
|
.check-options input:focus + .checkmark { outline: 2px solid #b6d9ca; }
|
||||||
|
.bulk-stock-picker { border: 1px solid #dce2df; border-radius: 9px; overflow: hidden; background: #fafcfb; }
|
||||||
|
.bulk-picker-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #e3e8e5; color: #52605b; font-size: 11px; font-weight: 700; }
|
||||||
|
.bulk-picker-head b { border-radius: 99px; padding: 4px 8px; background: #e3eee9; color: var(--green); font-size: 9px; }
|
||||||
|
.bulk-picker-placeholder { padding: 25px 14px; color: #89948f; text-align: center; font-size: 11px; }
|
||||||
|
.bulk-size-group { max-height: 265px; overflow-y: auto; padding: 5px 11px; }
|
||||||
|
.bulk-size-row { display: grid; grid-template-columns: 1fr 105px; gap: 14px; align-items: center; padding: 9px 2px; border-bottom: 1px solid #e9eeeb; }
|
||||||
|
.bulk-size-row:last-child { border-bottom: 0; }
|
||||||
|
.bulk-size-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
|
||||||
|
.bulk-size-check > input { position: absolute; opacity: 0; pointer-events: none; }
|
||||||
|
.bulk-size-check input:checked + .checkmark { background: var(--green); border-color: var(--green); color: white; }
|
||||||
|
.bulk-size-check input:focus + .checkmark { outline: 2px solid #b6d9ca; }
|
||||||
|
.bulk-size-check strong, .bulk-size-check small { display: block; }
|
||||||
|
.bulk-size-check strong { color: #33463f; font-size: 12px; }
|
||||||
|
.bulk-size-check small { color: #89948f; font-size: 9px; margin-top: 2px; font-weight: 500; }
|
||||||
|
.bulk-quantity { text-align: right; font-size: 9px; }
|
||||||
|
.bulk-quantity input { margin-top: 3px; padding: 8px 9px; text-align: right; }
|
||||||
|
.bulk-quantity input:disabled { background: #eef1ef; color: #adb5b1; }
|
||||||
|
|
||||||
@media (max-width: 760px) {
|
@media (max-width: 760px) {
|
||||||
.check-options { grid-template-columns: repeat(2, 1fr); }
|
.check-options { grid-template-columns: repeat(2, 1fr); }
|
||||||
|
.bulk-size-row { grid-template-columns: 1fr 90px; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,23 @@ class UniformWorkflowTest extends TestCase
|
||||||
$this->assertDatabaseHas('stock_movements', ['stock_variant_id' => $variant->id, 'type' => 'restock', 'quantity_change' => 4]);
|
$this->assertDatabaseHas('stock_movements', ['stock_variant_id' => $variant->id, 'type' => 'restock', 'quantity_change' => 4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_bulk_receiving_updates_multiple_sizes_in_one_submission(): void
|
||||||
|
{
|
||||||
|
$medium = $this->variant(3);
|
||||||
|
$large = $medium->item->variants()->create(['size' => 'L', 'quantity' => 2, 'reorder_level' => 2]);
|
||||||
|
|
||||||
|
$this->post(route('inventory.restock'), [
|
||||||
|
'uniform_item_id' => $medium->uniform_item_id,
|
||||||
|
'stocks' => [$medium->id => 5, $large->id => 8],
|
||||||
|
'notes' => 'Delivery GRN-100',
|
||||||
|
])->assertSessionHasNoErrors();
|
||||||
|
|
||||||
|
$this->assertSame(8, $medium->fresh()->quantity);
|
||||||
|
$this->assertSame(10, $large->fresh()->quantity);
|
||||||
|
$this->assertDatabaseHas('stock_movements', ['stock_variant_id' => $medium->id, 'quantity_change' => 5, 'notes' => 'Delivery GRN-100']);
|
||||||
|
$this->assertDatabaseHas('stock_movements', ['stock_variant_id' => $large->id, 'quantity_change' => 8, 'notes' => 'Delivery GRN-100']);
|
||||||
|
}
|
||||||
|
|
||||||
public function test_uniform_type_is_created_with_selected_sizes(): void
|
public function test_uniform_type_is_created_with_selected_sizes(): void
|
||||||
{
|
{
|
||||||
$this->post(route('inventory.items.store'), [
|
$this->post(route('inventory.items.store'), [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue