Exemplo n.º 1
0
    public DataTable getIVCostItems(int invoice_no)
    {
        SQL  = "SELECT * FROM invoice_cost_item";
        SQL += " WHERE elt_account_number=" + elt_account_number + " and invoice_no=" + invoice_no + " order by item_id";

        DataTable dt = new DataTable();

        //dt.Columns.Add(new DataColumn("ap_lock", System.Type.GetType("System.Boolean")));
        dt.Columns.Add(new DataColumn("bill_number", System.Type.GetType("System.Int32")));
        SqlDataAdapter ad = new SqlDataAdapter(SQL, Con);

        gUtil.removeNull(ref dt);
        try
        {
            ad.Fill(dt);
        }
        catch (Exception ex)
        {
            throw ex;
        }
        BillDetailManager bdMgr = new BillDetailManager(elt_account_number);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            int bill_number = 0;
            dt.Rows[i]["ap_lock"] = bdMgr.checkIfAPposted(Int32.Parse(dt.Rows[i]["invoice_no"].ToString()), Int32.Parse(dt.Rows[i]["item_no"].ToString()), Int32.Parse(dt.Rows[i]["item_id"].ToString()), Decimal.Parse(dt.Rows[i]["cost_amount"].ToString()), ref bill_number);
            if (Boolean.Parse(dt.Rows[i]["ap_lock"].ToString()))
            {
                dt.Rows[i]["bill_number"] = bill_number;
            }
        }
        return(dt);
    }
Exemplo n.º 2
0
 public BillManager(string elt_acct)
     : base(elt_acct)
 {
     bdMgr  = new BillDetailManager(elt_account_number);
     AAJMgr = new AllAccountsJournalManager(elt_account_number);
     glMgr  = new GLManager(elt_account_number);
 }
Exemplo n.º 3
0
 public ARNManager(string elt_acct)
     : base(elt_acct)
 {
     IVChManager   = new IVChargeItemsManager(elt_account_number);
     IVCostManager = new IVCostItemsManager(elt_account_number);
     bdMgr         = new BillDetailManager(elt_account_number);
     aajMgr        = new AllAccountsJournalManager(elt_account_number);
 }
Exemplo n.º 4
0
    public ArrayList getIVCostItemsList(int invoice_no)
    {
        SQL  = "SELECT * FROM invoice_cost_item";
        SQL += " WHERE elt_account_number=" + elt_account_number + " and invoice_no=" + invoice_no + " order by item_id";
        ArrayList      returnlist = new ArrayList();
        DataTable      dt         = new DataTable();
        SqlDataAdapter ad         = new SqlDataAdapter(SQL, Con);

        try
        {
            ad.Fill(dt);
            gUtil.removeNull(ref dt);
            BillDetailManager bdMgr = new BillDetailManager(elt_account_number);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                IVCostItemRecord IVCoR = new IVCostItemRecord();

                IVCoR.Invoice_no    = invoice_no;
                IVCoR.Item_desc     = dt.Rows[i]["item_desc"].ToString();
                IVCoR.Item_id       = Int32.Parse(dt.Rows[i]["item_id"].ToString());
                IVCoR.Item_no       = Int32.Parse(dt.Rows[i]["item_no"].ToString());
                IVCoR.Cost_amount   = Decimal.Parse(dt.Rows[i]["cost_amount"].ToString());
                IVCoR.Vendor_no     = Int32.Parse(dt.Rows[i]["vendor_no"].ToString());
                IVCoR.Ref_no        = dt.Rows[i]["ref_no"].ToString();
                IVCoR.IType         = dt.Rows[i]["iType"].ToString();
                IVCoR.Hb_no         = dt.Rows[i]["hb_no"].ToString();
                IVCoR.Mb_no         = dt.Rows[i]["mb_no"].ToString();
                IVCoR.Import_export = dt.Rows[i]["import_export"].ToString();
                int bill_number = 0;
                IVCoR.AP_Posted   = bdMgr.checkIfAPposted(IVCoR.Invoice_no, IVCoR.Item_no, IVCoR.Item_id, IVCoR.Cost_amount, ref bill_number);
                IVCoR.Bill_number = bill_number;
                returnlist.Add(IVCoR);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return(returnlist);
    }