Raktárközi átadásról és szállítói visszárúról lehet szállítólevelet készíteni

This commit is contained in:
2017-07-25 16:01:15 +02:00
parent 1998088f31
commit 484309b6d6
13 changed files with 577 additions and 125 deletions
@@ -30,6 +30,8 @@
{
this.components = new System.ComponentModel.Container();
this.aCreateDeliveryNoteOutfromStorageOut = new DevExpress.ExpressApp.Actions.PopupWindowShowAction(this.components);
this.aPrint_DeliveryNoteOutHeader = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
this.aStornoDeliveryNoteOutfromStorageOut = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
//
// aCreateDeliveryNoteOutfromStorageOut
//
@@ -38,20 +40,50 @@
this.aCreateDeliveryNoteOutfromStorageOut.Caption = "aCreate Delivery Note Outfrom Storage Out";
this.aCreateDeliveryNoteOutfromStorageOut.ConfirmationMessage = null;
this.aCreateDeliveryNoteOutfromStorageOut.Id = "aCreateDeliveryNoteOutfromStorageOut";
this.aCreateDeliveryNoteOutfromStorageOut.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
this.aCreateDeliveryNoteOutfromStorageOut.TargetObjectType = typeof(Nuvolar.Module.StorageOutHeader);
this.aCreateDeliveryNoteOutfromStorageOut.TargetViewNesting = DevExpress.ExpressApp.Nesting.Root;
this.aCreateDeliveryNoteOutfromStorageOut.TargetViewType = DevExpress.ExpressApp.ViewType.ListView;
this.aCreateDeliveryNoteOutfromStorageOut.ToolTip = null;
this.aCreateDeliveryNoteOutfromStorageOut.TypeOfView = typeof(DevExpress.ExpressApp.ListView);
this.aCreateDeliveryNoteOutfromStorageOut.CustomizePopupWindowParams += new DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventHandler(this.aCreateDeliveryNoteOutfromStorageOut_CustomizePopupWindowParams);
this.aCreateDeliveryNoteOutfromStorageOut.Execute += new DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventHandler(this.aCreateDeliveryNoteOutfromStorageOut_Execute);
//
// aPrint_DeliveryNoteOutHeader
//
this.aPrint_DeliveryNoteOutHeader.Caption = "aPrint_DeliveryNoteOutHeader";
this.aPrint_DeliveryNoteOutHeader.ConfirmationMessage = null;
this.aPrint_DeliveryNoteOutHeader.Id = "aPrint_DeliveryNoteOutHeader";
this.aPrint_DeliveryNoteOutHeader.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
this.aPrint_DeliveryNoteOutHeader.TargetObjectType = typeof(Nuvolar.Module.StorageOutHeader);
this.aPrint_DeliveryNoteOutHeader.TargetViewNesting = DevExpress.ExpressApp.Nesting.Root;
this.aPrint_DeliveryNoteOutHeader.TargetViewType = DevExpress.ExpressApp.ViewType.ListView;
this.aPrint_DeliveryNoteOutHeader.ToolTip = null;
this.aPrint_DeliveryNoteOutHeader.TypeOfView = typeof(DevExpress.ExpressApp.ListView);
this.aPrint_DeliveryNoteOutHeader.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aPrint_DeliveryNoteOutHeader_Execute);
//
// aStornoDeliveryNoteOutfromStorageOut
//
this.aStornoDeliveryNoteOutfromStorageOut.Caption = "aStorno Delivery Note Outfrom Storage Out";
this.aStornoDeliveryNoteOutfromStorageOut.ConfirmationMessage = null;
this.aStornoDeliveryNoteOutfromStorageOut.Id = "aStornoDeliveryNoteOutfromStorageOut";
this.aStornoDeliveryNoteOutfromStorageOut.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
this.aStornoDeliveryNoteOutfromStorageOut.TargetObjectType = typeof(Nuvolar.Module.StorageOutHeader);
this.aStornoDeliveryNoteOutfromStorageOut.ToolTip = null;
this.aStornoDeliveryNoteOutfromStorageOut.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aStornoDeliveryNoteOutfromStorageOut_Execute);
//
// StorageOut_VC
//
this.Actions.Add(this.aCreateDeliveryNoteOutfromStorageOut);
this.Actions.Add(this.aPrint_DeliveryNoteOutHeader);
this.Actions.Add(this.aStornoDeliveryNoteOutfromStorageOut);
}
#endregion
private DevExpress.ExpressApp.Actions.PopupWindowShowAction aCreateDeliveryNoteOutfromStorageOut;
private DevExpress.ExpressApp.Actions.SimpleAction aPrint_DeliveryNoteOutHeader;
private DevExpress.ExpressApp.Actions.SimpleAction aStornoDeliveryNoteOutfromStorageOut;
}
}
@@ -13,6 +13,9 @@ using DevExpress.ExpressApp.Templates;
using DevExpress.ExpressApp.Utils;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.Validation;
using DevExpress.ExpressApp.Xpo;
using DevExpress.Persistent.BaseImpl;
using Nuvolar.Module.Helpers;
namespace Nuvolar.Module.Controllers
{
@@ -39,5 +42,107 @@ namespace Nuvolar.Module.Controllers
// Unsubscribe from previously subscribed events and release other references and resources.
base.OnDeactivated();
}
/// <summary>
/// Kitárolási bizonylatról => szállítólevél (egy az egyben !)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void aCreateDeliveryNoteOutfromStorageOut_Execute(object sender, PopupWindowShowActionExecuteEventArgs e)
{
//Ellenőrzés, hogy készült-e már minden kitárolási sorról szállítólevél
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
StorageOutHeader _StorageOutHeader = _ocur.GetObject(View.CurrentObject) as StorageOutHeader;
bool _Ok = true;
foreach (StorageOutRows _StorageOutRows in _StorageOutHeader.StorageOutRows)
{
if (_StorageOutRows.QTT_To_DeliveryOut == _StorageOutRows.QTT)
{
_Ok = false;
break;
}
}
if (_StorageOutHeader.DeliveryNoteOutHeader != null)
{
_Ok = false;
}
if (_Ok)
{
DeliveryNoteOutHeader _DeliveryNoteOutHeader = BusinessDocumentHelper.CreateNewDeliveryNoteOutHeader(_ocur, e.PopupWindow.View.CurrentObject as DeliveryNoteView);
long i = 1;
foreach (StorageOutRows _StorageOutRows in _StorageOutHeader.StorageOutRows)
{
foreach (StorageOutRowsInRows _StorageOutRowsInRows in _StorageOutRows.StorageOutRowsInRows)
{
_StorageOutRowsInRows.QTT_Will = _StorageOutRowsInRows.QTT;
BusinessDocumentHelper.AddNewDeliveryNoteOutRows(_ocur, _DeliveryNoteOutHeader, _StorageOutRowsInRows, i);
i += 1;
}
}
if (BusinessDocumentHelper.FinalizeDeliveryNoteOutHeader(_ocur, _DeliveryNoteOutHeader, _StorageOutHeader))
{
//Nyomtatás
BusinessDocumentHelper.PrintDeliveryNoteOutHeader(_ocur, Frame, _DeliveryNoteOutHeader);
}
}
}
private void aCreateDeliveryNoteOutfromStorageOut_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
{
XPObjectSpace _onew = Application.CreateObjectSpace() as XPObjectSpace;
DeliveryNoteView _DeliveryNoteView = _onew.CreateObject<DeliveryNoteView>();
StorageOutHeader _StorageOutHeader = _onew.GetObject(View.CurrentObject) as StorageOutHeader;
_DeliveryNoteView.Customers = _StorageOutHeader.Customers;
_DeliveryNoteView.TransportAddress = _StorageOutHeader.Storage.Address;
_DeliveryNoteView.DateExecution = DateTime.Now;
_DeliveryNoteView.CurrencyName = _onew.FindObject<CurrencyName>(CriteriaOperator.Parse("ShortName='HUF'"));
if (_StorageOutHeader.StorageMoveType.MoveType==eMoveType.InventoryTransfer)
{
_DeliveryNoteView.DeliveryNoteOutType = _StorageOutHeader.Storage.DeliveryNoteOutType_InventoryTransfer;
}
if (_StorageOutHeader.StorageMoveType.MoveType == eMoveType.ReturnBack)
{
_DeliveryNoteView.DeliveryNoteOutType = _StorageOutHeader.Storage.DeliveryNoteOutType_ReturnBack;
}
if (_StorageOutHeader.Customers != null)
{
if (_StorageOutHeader.Customers.Address1 != null) _DeliveryNoteView.TransportAddress = _onew.GetObjectByKey<Address>(_StorageOutHeader.Customers.Address1.Oid);
if (_StorageOutHeader.Customers.Address2 != null) _DeliveryNoteView.TransportAddress = _onew.GetObjectByKey<Address>(_StorageOutHeader.Customers.Address2.Oid);
if (_StorageOutHeader.Customers.ShipmentOption != null) _DeliveryNoteView.ShipmentOption = _onew.GetObjectByKey<ShipmentOption>(_StorageOutHeader.Customers.ShipmentOption.Oid);
if (_StorageOutHeader.Customers.QualityOption != null) _DeliveryNoteView.QualityOption = _onew.GetObjectByKey<QualityOption>(_StorageOutHeader.Customers.QualityOption.Oid);
}
e.View = Application.CreateDetailView(_onew, "DeliveryNoteView_DetailView", false, _DeliveryNoteView);
}
/// <summary>
/// Kitárolási bizonylathoz kapcsolódó szállítólevél újranyomtatása
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void aPrint_DeliveryNoteOutHeader_Execute(object sender, SimpleActionExecuteEventArgs e)
{
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
StorageOutHeader _StorageOutHeader = View.CurrentObject as StorageOutHeader;
BusinessDocumentHelper.PrintDeliveryNoteOutHeader(_ocur, Frame, _StorageOutHeader.DeliveryNoteOutHeader);
}
private void aStornoDeliveryNoteOutfromStorageOut_Execute(object sender, SimpleActionExecuteEventArgs e)
{
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
StorageOutHeader _StorageOutHeader = View.CurrentObject as StorageOutHeader;
DeliveryNoteOutHeader _DeliveryNoteOutHeader = BusinessDocumentHelper.StornoDeliveryNoteOutHeaderfromStorageOutHeader(_ocur, _StorageOutHeader);
if (_DeliveryNoteOutHeader!=null)
{
BusinessDocumentHelper.PrintDeliveryNoteOutHeader(_ocur, Frame, _DeliveryNoteOutHeader);
}
}
}
}
@@ -118,7 +118,13 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="aCreateDeliveryNoteOutfromStorageOut.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
<value>17, 56</value>
</metadata>
<metadata name="aPrint_DeliveryNoteOutHeader.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>290, 17</value>
</metadata>
<metadata name="aStornoDeliveryNoteOutfromStorageOut.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>290, 56</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>