private void cmdAddProduct_Click(object sender, RoutedEventArgs e)
        {
            WinAddEditMiscItemComplex w = new WinAddEditMiscItemComplex();

            w.Caption    = (String)(sender as Button).Content + " " + getCaptionKey();
            w.Mode       = "A";
            w.ParentView = (vw as MAccountDoc);
            w.ShowDialog();
            if (w.HasModified)
            {
                vw.CalculateExtraFields();
                vw.IsModified = true;
            }
        }
        private void cmdAddProduct_Click(object sender, RoutedEventArgs e)
        {
            WinAddEditAccountPurchaseDocItem w = new WinAddEditAccountPurchaseDocItem(false);

            w.Caption    = (String)(sender as Button).Content + " " + CLanguage.getValue("purchase_item");
            w.Mode       = "A";
            w.ParentView = (vw as MAccountDoc);
            w.ShowDialog();
            if (w.HasModified)
            {
                vw.CalculateExtraFields();
                vw.IsModified = true;
            }
        }
Пример #3
0
        private MAccountDoc constructInvoiceFromSaleOrder(MAccountDoc saleOrder)
        {
            CTable so = OnixWebServiceAPI.GetAccountDocInfo(saleOrder.GetDbObject());

            MAccountDoc sod = new MAccountDoc(so);

            sod.InitAccountDocItem();
            sod.InitEntityAddresses();

            MAccountDoc md = new MAccountDoc(new CTable(""));

            md.DocumentType = ((int)docType).ToString();
            md.DocumentDate = sod.DocumentDate;
            md.DocumentDesc = sod.DocumentDesc;
            md.DueDate      = sod.DocumentDate;

            md.ProjectID        = sod.ProjectID;
            md.ProjectCode      = sod.ProjectCode;
            md.ProjectName      = sod.ProjectName;
            md.ProjectGroupName = sod.ProjectGroupName;

            md.EntityId        = sod.EntityId;
            md.EntityCode      = sod.EntityCode;
            md.EntityName      = sod.EntityName;
            md.EntityAddressID = sod.EntityAddressID;

            md.EmployeeID   = sod.EmployeeID;
            md.EmployeeCode = sod.EmployeeCode;
            md.EmployeeName = sod.EmployeeName;

            CTable  cust = OnixWebServiceAPI.GetEntityInfo(sod.EntityObj.GetDbObject());
            MEntity en   = new MEntity(cust);

            en.InitEntityAddress();
            md.ReloadEntityAddresses(en.AddressItems);

            md.BranchId       = sod.BranchId;
            md.VATType        = sod.VATType;
            md.VAT_PCT        = sod.VAT_PCT;
            md.RefSaleOrderNo = sod.DocumentNo;
            md.RefSaleOrderID = sod.AccountDocId;
            md.RefPoNo        = sod.RefPoNo;
            md.RefQuotationNo = sod.RefQuotationNo;

            foreach (MAccountDocItem ad in sod.AccountItem)
            {
                MAccountDocItem adi = new MAccountDocItem(ad.GetDbObject());
                adi.ProjectID   = sod.ProjectID;
                adi.ProjectCode = sod.ProjectCode;
                adi.ProjectName = sod.ProjectName;

                adi.ExtFlag = "A";
                md.AddAccountDocItem(adi);
            }

            md.CalculateExtraFields();
            md.IsModified = true;

            return(md);
        }
Пример #4
0
        private MAccountDoc constructSaleOrderFromQuotation(MAuxilaryDoc quotation)
        {
            CTable qt = OnixWebServiceAPI.GetAuxilaryDocInfo(quotation.GetDbObject());

            MAuxilaryDoc qd = new MAuxilaryDoc(qt);

            qd.InitAuxilaryDocItem();
            qd.InitEntityAddresses();

            MAccountDoc md = new MAccountDoc(new CTable(""));

            md.DocumentType = ((int)AccountDocumentType.AcctDocSaleOrder).ToString();
            md.DocumentDate = qd.DocumentDate;
            md.DocumentDesc = qd.DocumentDesc;
            md.DueDate      = qd.DocumentDate;

            md.ProjectID        = qd.ProjectID;
            md.ProjectCode      = qd.ProjectCode;
            md.ProjectName      = qd.ProjectName;
            md.ProjectGroupName = qd.ProjectGroupName;

            md.EntityId        = qd.EntityId;
            md.EntityCode      = qd.EntityCode;
            md.EntityName      = qd.EntityName;
            md.EntityAddressID = qd.EntityAddressID;

            md.EmployeeID   = qd.EmployeeID;
            md.EmployeeCode = qd.EmployeeCode;
            md.EmployeeName = qd.EmployeeName;

            CTable  cust = OnixWebServiceAPI.GetEntityInfo(qd.EntityObj.GetDbObject());
            MEntity en   = new MEntity(cust);

            en.InitEntityAddress();
            md.ReloadEntityAddresses(en.AddressItems);

            md.BranchId       = qd.BranchId;
            md.VATType        = qd.VatType;
            md.RefQuotationNo = qd.DocumentNo;
            md.RefQuotationID = qd.AuxilaryDocID;

            foreach (MAuxilaryDocItem ad in qd.AuxilaryDocItems)
            {
                MAccountDocItem adi = new MAccountDocItem(ad.GetDbObject());
                adi.ExtFlag = "A";
                md.AddAccountDocItem(adi);
            }

            md.CalculateExtraFields();
            md.IsModified = true;

            return(md);
        }
        private void ShowEditWindow()
        {
            WinAddEditAccountPurchaseDocItemApproved w = new WinAddEditAccountPurchaseDocItemApproved(false);

            w.ViewData = currentViewObj;
            w.Caption  = CLanguage.getValue("ADMIN_EDIT") + " " + CLanguage.getValue("purchase_item");
            w.Mode     = "E";
            w.ShowDialog();

            if (w.HasModified)
            {
                vw.CalculateExtraFields();
                vw.IsModified = true;
            }
        }
 private void cbxCheckBox_Checked(object sender, RoutedEventArgs e)
 {
     calculatePromotion();
     vw.CalculateExtraFields();
     vw.IsModified = true;
 }