Warenwirtschaft: F-12 — Verkaufs-Gegenbuchungen im Monatsverbrauch netto verrechnen
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
691f763011
commit
8c460aa8bf
2 changed files with 23 additions and 3 deletions
|
|
@ -271,3 +271,17 @@ test('uebersicht zeigt verbrauch-spalte und alle kacheln klickbar', function ()
|
|||
expect(substr_count($response->getContent(), 'wawi-stat is-clickable')
|
||||
+ substr_count($response->getContent(), 'is-clickable" data-filter'))->toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
|
||||
test('F-12: verkaufs-gegenbuchungen werden im monatsverbrauch netto verrechnet', function () {
|
||||
$product = ap11MakeProduct('F12-Netto');
|
||||
$service = app(ProductStockService::class);
|
||||
|
||||
// Versand 60 → Rücksetzung (Gegenbuchung 60) → erneuter Versand 60: Nettoabgang 60.
|
||||
$service->recordMovement($product, 'out', 60, 'Verkauf', 'sale');
|
||||
$service->recordMovement($product, 'in', 60, 'Verkauf storniert', 'sale');
|
||||
$service->recordMovement($product, 'out', 60, 'Verkauf', 'sale');
|
||||
// Manueller Eingang zählt weiterhin nicht gegen den Verbrauch.
|
||||
$service->recordMovement($product, 'in', 500, 'Initialbestand');
|
||||
|
||||
expect($service->monthlyConsumptionByProduct([$product->id])[$product->id])->toBe(10.0);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue