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:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user