<?php

/**
 * Subclass for performing query and update operations on the 'katao_supplier_invoice' table.
 *
 * @package lib.model
 */
class KataoSupplierInvoicePeer extends BaseKataoSupplierInvoicePeer {
    public static function getAllStatuses() {
        return array(KataoSupplierInvoice::STATUS_RECEIVED => self::getStatusStr(KataoSupplierInvoice::STATUS_RECEIVED), KataoSupplierInvoice::STATUS_PAID => self::getStatusStr(KataoSupplierInvoice::STATUS_PAID));
    }

    public static function getStatusStr($status) {
        switch ($status) {
            case KataoSupplierInvoice::STATUS_RECEIVED:
                return 'Reçue';
            case KataoSupplierInvoice::STATUS_PAID:
                return 'Payée';
        }
        return '';
    }

    public static function getAllPaymentModes() {
        return array(KataoSupplierInvoice::PAYMENT_MODE_BANK_TRANSFER => self::getPaymentModeStr(KataoSupplierInvoice::PAYMENT_MODE_BANK_TRANSFER), KataoSupplierInvoice::PAYMENT_MODE_CREDIT_CARD => self::getPaymentModeStr(KataoSupplierInvoice::PAYMENT_MODE_CREDIT_CARD), KataoSupplierInvoice::PAYMENT_MODE_CHECK => self::getPaymentModeStr(KataoSupplierInvoice::PAYMENT_MODE_CHECK));
    }

    public static function getPaymentModeStr($status) {
        switch ($status) {
            case KataoSupplierInvoice::PAYMENT_MODE_BANK_TRANSFER:
                return 'Virement';
            case KataoSupplierInvoice::PAYMENT_MODE_CREDIT_CARD:
                return 'CB';
            case KataoSupplierInvoice::PAYMENT_MODE_CHECK:
                return 'Chèque';
        }
        return '';
    }
}