Dokument WZR posiadał 1 pozycje na 4 sztuki która po zatwierdzeniu
otrzymała 2 wyceny zgodnie z FIFO. Powstała pozycja nr 1 i 2
Proba korekty pozycji nr 1 powoduje informacje ze brak stanu.
selectdl.documentOrdinalNumber,dl.itemQuantityLeft,documentlineid,sysCorrectedItemPrice,documentLineId,locationid,itemSerialNumber,casewhendl.itemQuantityLeft!=dl.correctedItemQuantitythencast(dl.itemQuantityLeft*dl.sysCorrectedItemPriceasdecimal(18,2))elseabs(round(dl.correctedItemValue*isnull(d.currencyExchangeRate,1),2))-(dl.correctedItemQuantity-dl.itemQuantityLeft)*dl.sysCorrectedItemPrice/*sys wyjdzie na to samo co waluta bo to korekta rozchodu a na razie nie ma rozch walutowych*/endfromdocument.documentLinedlinnerjoindocument.documentdond.documentID=dl.documentIDwheredl.documentID='E25E31A4-BBBC-E811-941C-D89D6719E0CA'--and dl.documentOrdinalNumber = @draftDocumentOrdinalNumberanddl.[status]>0--and dl.itemQuantityLeft > 0orderbydl.documentOrdinalNumber