cashMovementLayout function

ReceiptLayout cashMovementLayout(
  1. CashMovementReceipt receipt, {
  2. PosPaperSize paperSize = PosPaperSize.mm58,
})

Bon einer Kassenbewegung (Einzahlung, Auszahlung, Umbuchung). Wirft (KasseneckValidationError, kind: request), wenn die Bon-Daten keine Kassenbewegung sind.

Implementation

ReceiptLayout cashMovementLayout(CashMovementReceipt receipt, {PosPaperSize paperSize = PosPaperSize.mm58}) {
  bewegungsBonPruefen('cashMovementLayout', receipt);
  final bon = receipt;
  final zeilen = <LayoutLine>[];
  _kopfblock(zeilen, bon, 'shift_receipt.title_movement');
  if (bon.shiftNumber != null) {
    zeilen.add(_kopf(labelText('shift_receipt.shift'), labelText('shift_receipt.number', {'number': bon.shiftNumber!})));
  }
  zeilen.add(_regel());
  zeilen.add(_kopf(labelText('shift_receipt.movement_number'), '${bon.number}'));
  zeilen.add(_kopf(labelText('shift_receipt.type'), _artText(bon.type)));
  zeilen.add(_betrag(labelText('shift_receipt.amount'), bon.amountCents));
  _wennText(zeilen, labelText('shift_receipt.location'), bon.location == null ? null : _ortText(bon.location!));
  _wennText(zeilen, labelText('shift_receipt.recipient'), bon.recipientName);
  _wennText(zeilen, labelText('shift_receipt.target_drawer'), bon.targetDrawerName);
  _wennText(zeilen, labelText('shift_receipt.note'), bon.note);
  _wennText(zeilen, labelText('shift_receipt.operator'), bon.byName);
  _wennText(zeilen, labelText('shift_receipt.time'), _zeit(bon.at));
  return ReceiptLayout(lines: zeilen, paperSize: paperSize.value, ruleset: _regelwerk);
}