/*
 * This file is part of the xTuple ERP: PostBooks Edition, a free and
 * open source Enterprise Resource Planning software suite,
 * Copyright (c) 1999-2009 by OpenMFG LLC, d/b/a xTuple.
 * It is licensed to you under the Common Public Attribution License
 * version 1.0, the full text of which (including xTuple-specific Exhibits)
 * is available at www.xtuple.com/CPAL.  By using this software, you agree
 * to be bound by its terms.
 */

#ifndef WORKORDER_H
#define WORKORDER_H

#include "guiclient.h"
#include "xwidget.h"
#include <QStandardItemModel>
#include <parameter.h>
#include "ui_workOrder.h"

class workOrder : public XWidget, public Ui::workOrder
{
    Q_OBJECT

public:
    workOrder(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window);
    ~workOrder();

public slots:
    virtual SetResponse set( const ParameterList & pParams );
    virtual void sCreate();
    virtual void sUpdateStartDate();
    virtual void sPopulateLeadTime( int pWarehousid );
    virtual void sPopulateItemChar( int pItemid );
    virtual void populateWoNumber();
    virtual void sClose();
    virtual void sHandleButtons();

protected slots:
    virtual void languageChange();

private:
    bool _captive;
    int _planordid;
    int _sense;
    int _sourceid;
    QString _planordtype;
    int _mode;
    int _lastWarehousid;
    int _lastItemid;
    QStandardItemModel * _itemchar;
    int _woid;

    int _oldPriority;
    QDate _oldStartDate;
    QDate _oldDueDate;
    double _oldQty;

};

#endif // WORKORDER_H
