public function unpaidStatementsCount() { return PayeePayment::unpaidWherePayeeCode($this->code)->count(); }
public static function apiExportUnpaidPayeeStatements() { if (isset($_GET['payeeCode'])) { $results = PayeePayment::unpaidWherePayeeCode($_GET['payeeCode'])->join('user', 'payee_payment.payee_code', '=', 'user.code')->orderBy('id', 'desc')->get(PayeePayment::$PAYMENT_CSV_SQL_DATA)->toArray(); return PayeePayment::exportStatementToCsv($results); } }