stockArticleOutput<A extends ArticleRawAbstract> method
double
stockArticleOutput<
A extends ArticleRawAbstract>( - A article, {
- DateRange? range,
})
Implementation
double stockArticleOutput<A extends ArticleRawAbstract>(A article,
{DateRange? range}) {
double stockCount = 0.0;
for (final ticket in this) {
if (ticket.status) {
if (ticket.ticketType.isBoutiqueOutput) {
if (range == null || ticket.date.isDateInDateRange(range)) {
if (ticket.items.isNotEmpty) {
for (final item in ticket.items) {
// below prevents us from counting twice inventory qt
// it guarantees that only negative qts are substracted from stock
// note : inventory is the only type with negative quantity
if (ticket.ticketType == TicketType.inventory) {
final temp = item.getStockMovementForArticle(article);
if (temp < 0) {
stockCount += temp;
}
} else {
stockCount += item.getStockMovementForArticle(article);
}
}
}
}
}
}
}
return stockCount;
}