Procedura-POSCountPaymentsForValidate

Popis:
Počet plateb

Parametry:

NázevPopisDatový typ
adocument_idChar(10)
apaymenttype_idChar(10)
acurrency_idChar(10)
apaymentFloat(0, 0)

Návratové hodnoty:

NázevPopisDatový typ
acountInteger

Tělo:

begin
  select count(pd3.id)
  from posdocuments3 pd3
  where
    pd3.parent_ID = :aDocument_ID and
    pd3.paymenttype_id = :aPaymentType_ID and
    pd3.Currency_id = :aCurrency_ID and
    pd3.payment=:aPayment
  into
    mpayment;
  select count(pd3.id) as plus
  from posdocuments3 pd3
  where
    pd3.parent_ID = :aDocument_ID and
    pd3.paymenttype_id = :aPaymentType_ID and
    pd3.Currency_id = :aCurrency_ID and
    pd3.refund = :aPayment
  into
    mrefund;
  acount = mpayment - mrefund;
  suspend;
end

Generated by ABRA Software a.s. 27.10.2021 16:34:31