#include "util.h"
#include "preDefine.h"

QString Penny2Dollar(int penny)
{
    double dollar = (double)penny/100;
    return QString::number(dollar,'f',2);
}

QString GetOperByStatus(int status)
{
    switch(status)
    {
    case 1:
        return OPERATION_CONFRIM;
        break;
    case 2:
        return OPERATION_SENDOUT;
        break;
    case 5:
    case 4:
        return OPERATION_COMPLETE;
        break;
    case 6:
    case 200:
        return "NULL";
        break;
    case 20:
    case 22:
        return OPERATION_AGREEREFUND;
        break;
    default:
        return "NULL";
        break;
    }
}

QString GetOperNameByStatus(int status)
{
    switch(status)
    {
    case 1:
        return OPERATIONNAME_GETDELIVERS;
        break;
    case 2:
        return OPERATIONNAME_SENDOUT;
        break;
    case 5:
    case 4:
        return OPERATIONNAME_COMPLETE;
        break;
    case 6:
    case 200:
        return "NULL";
        break;
    case 20:
    case 22:
        return OPERATIONNAME_AGREEREFUND;
        break;
    default:
        return "NULL";
        break;
    }
}
