示例#1
0
        private void btnReturn_Click(object sender, EventArgs e)
        {
            //TODO: finish updating the changed locations
            MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
            if (gridGRVs.DataSource == null)
            {
                return;
            }
            transaction.BeginTransaction();
            try
            {
                PalletLocation pl     = new PalletLocation();
                BLL.ReceiveDoc recDoc = new ReceiveDoc();
                recDoc.LoadByReceiptID(ReceiptID);
                recDoc.ConfirmGRNFPrinted(null);

                BLL.Receipt receiptStatus = new BLL.Receipt();
                receiptStatus.LoadByPrimaryKey(ReceiptID);
                receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRNF_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Return For Price Change");


                transaction.CommitTransaction();

                this.LogActivity("Return-For-Costing", ReceiptID);
                XtraMessageBox.Show("Receipt Returned!", "Success", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
            }
            catch (Exception exp)
            {
                transaction.RollbackTransaction();
                throw exp;
            }
            PutAwayListsLoad(null, null);
        }
        private void btnReturn_Click(object sender, EventArgs e)
        {
            var recDoc = new ReceiveDoc();

            recDoc.LoadByReceiptID(receipt.ID);
            recDoc.ConfirmGRNFPrinted(CurrentContext.UserId);
            receipt.ChangeStatus(ReceiptConfirmationStatus.Constants.GRNF_PRINTED, null,
                                 this.GetFormIdentifier(), CurrentContext.UserId, "Price Set");
            MessageBox.Show("The Correction has been return to Pricing", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#3
0
        private void ReturnFromGRVPrinting()
        {
            int ReceiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"]); var receiveDoc = new ReceiveDoc();

            receiveDoc.LoadByReceiptID(ReceiptID);
            receiveDoc.ConfirmGRNFPrinted(null);
            BLL.Receipt receiptStatus = new BLL.Receipt();
            receiptStatus.LoadByPrimaryKey(ReceiptID);
            receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.PRICE_CALCULATED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Return For Price Change");
            BindFormContents();
            this.LogActivity("Return-SRM-To-Costing", ReceiptID);
        }
示例#4
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DataRow dataRow = gridReceiveView.GetFocusedDataRow();

            if (dataRow != null)
            {
                if (Convert.ToInt32(dataRow["ReceiptConfirmationStatusID"]) == ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED)
                {
                    ReceiptID = Convert.ToInt32(dataRow["ReceiptID"]);
                    PrintDialog printDialog = new PrintDialog();
                    printDialog.PrinterSettings.Copies = BLL.Settings.GRNFCopies;

                    DialogResult dialogResult = printDialog.ShowDialog();

                    if (dialogResult != DialogResult.OK)
                    {
                        MessageBox.Show("Printing Canceled by user", "Cancel Printint...", MessageBoxButtons.OK,
                                        MessageBoxIcon.Asterisk);
                        return;
                    }

                    TransactionMgr transaction = TransactionMgr.ThreadTransactionMgr();
                    XtraReport     printout;
                    try
                    {
                        transaction.BeginTransaction();
                        printout = WorkflowReportFactory.CreateGRNFPrintout(ReceiptID, null, false, FiscalYear.Current);
                        var receipt = new BLL.Receipt(ReceiptID);

                        var recDoc = new ReceiveDoc();
                        recDoc.LoadByReceiptID(ReceiptID);


                        if (receipt.ReceiptInvoice.PO.PurchaseType == BLL.POType.STORE_TO_STORE_TRANSFER || !BLL.Settings.HandleGRV)
                        {
                            recDoc.ConfirmGRVPrinted(CurrentContext.UserId);
                            BLL.Receipt receiptStatus = new BLL.Receipt();
                            receiptStatus.LoadByPrimaryKey(ReceiptID);
                            receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRV_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Transfer Confirmed");
                        }
                        else
                        {
                            recDoc.ConfirmGRNFPrinted(CurrentContext.UserId);

                            BLL.Receipt receiptStatus = new BLL.Receipt();
                            receiptStatus.LoadByPrimaryKey(ReceiptID);
                            receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRNF_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "GRNF Printed");
                        }
                        transaction.CommitTransaction();
                    }
                    catch (Exception exception)
                    {
                        transaction.RollbackTransaction();

                        XtraMessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        throw;
                    }


                    for (int i = 0; i < printDialog.PrinterSettings.Copies; i++)
                    {
                        printout.Print(printDialog.PrinterSettings.PrinterName);
                    }

                    ReceiptConfirmation_Load(null, null);
                }
                else
                {
                    XtraMessageBox.Show("The selected receipt has to be confirmed before GRNF is printed!", "ERROR", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                }
            }
        }