Exemplo n.º 1
0
        public void InitializeSaleOrderShipmentReport(ICSaleOrderShipment report)
        {
            SaleOrderShipmentEntities  entity     = CurrentModuleEntity as SaleOrderShipmentEntities;
            ICShipmentsInfo            mainObject = entity.MainObject as ICShipmentsInfo;
            ICShipmentItemsController  objShipmentItemsController = new ICShipmentItemsController();
            List <ICShipmentItemsInfo> shipmentItemList           = objShipmentItemsController.GetShipmentItemForReport(mainObject.ICShipmentID);

            report.bsICShipmentItems.DataSource = shipmentItemList;
        }
Exemplo n.º 2
0
        public void ActionNewFromSaleOrederShipment()
        {
            base.ActionNew();
            InvoiceEntities entity     = CurrentModuleEntity as InvoiceEntities;
            ARInvoicesInfo  mainObject = entity.MainObject as ARInvoicesInfo;

            ICShipmentItemsController  objShipmentItemsController = new ICShipmentItemsController();
            List <ICShipmentItemsInfo> shipmentItems = objShipmentItemsController.GetShipmentItemForInvoice();

            guiChooseShipmentItem guiFind = new guiChooseShipmentItem(shipmentItems);

            guiFind.Module = this;
            DialogResult rs = guiFind.ShowDialog();

            if (rs != DialogResult.OK)
            {
                ActionCancel();
                return;
            }
            shipmentItems = guiFind.SelectedObjects as List <ICShipmentItemsInfo>;

            ICShipmentItemsInfo    objShipmentItemsInfo    = shipmentItems.FirstOrDefault();
            ARSaleOrdersController objSaleOrdersController = new ARSaleOrdersController();
            ARSaleOrdersInfo       objSaleOrdersInfo       = objSaleOrdersController.GetObjectByID(objShipmentItemsInfo.FK_ARSaleOrderID) as ARSaleOrdersInfo;

            mainObject.FK_ARSaleOrderID                 = objSaleOrdersInfo.ARSaleOrderID;
            mainObject.ARInvoiceCustomerAddress         = objSaleOrdersInfo.ARSaleOrderCustomerAddress;
            mainObject.ARInvoiceCustomerDeliveryAddress = objSaleOrdersInfo.ARSaleOrderCustomerDeliveryAddress;
            mainObject.ARInvoiceCustomerDeliveryName    = objSaleOrdersInfo.ARSaleOrderCustomerDeliveryName;
            mainObject.ARInvoiceCustomerDeliveryPhone   = objSaleOrdersInfo.ARSaleOrderCustomerDeliveryPhone;
            mainObject.ARInvoiceCustomerName            = objSaleOrdersInfo.ARSaleOrderCustomerName;
            mainObject.ARInvoiceCustomerPhone           = objSaleOrdersInfo.ARSaleOrderCustomerPhone;
            mainObject.ARInvoiceCustomerTaxCode         = objSaleOrdersInfo.ARSaleOrderCustomerTaxCode;
            mainObject.ARInvoiceDiscountPercent         = objSaleOrdersInfo.ARSaleOrderDiscountPercent;
            mainObject.ARInvoiceTaxPercent              = objSaleOrdersInfo.ARSaleOrderTaxPercent;
            mainObject.ARInvoiceExchangeRate            = objSaleOrdersInfo.ARSaleOrderExchangeRate;
            mainObject.ARInvoiceDeliveryDate            = objSaleOrdersInfo.ARSaleOrderDeliveryDate;
            mainObject.ARInvoiceInternalComment         = objSaleOrdersInfo.ARSaleOrderInternalComment;
            mainObject.ARInvoiceComment                 = objSaleOrdersInfo.ARSaleOrderComment;
            mainObject.FK_GECurrencyID       = objSaleOrdersInfo.FK_GECurrencyID;
            mainObject.FK_ARCustomerID       = objSaleOrdersInfo.FK_ARCustomerID;
            mainObject.FK_HRSellerEmployeeID = objSaleOrdersInfo.FK_HRSellerEmployeeID;

            entity.GenerateInvoiceItemList(shipmentItems);
            UpdateTotalAmount();
            entity.UpdateMainObjectBindingSource();
        }