Na MOST JÓ !!!

This commit is contained in:
2018-04-22 23:46:07 +02:00
parent 714241c3a0
commit c4223f324d
7 changed files with 85 additions and 14 deletions
@@ -11,8 +11,10 @@ using DevExpress.ExpressApp.Model.NodeGenerators;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp.Templates;
using DevExpress.ExpressApp.Utils;
using DevExpress.ExpressApp.Xpo;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;
namespace Nuvolar.Module.CSharp
{
@@ -39,17 +41,44 @@ namespace Nuvolar.Module.CSharp
// Unsubscribe from previously subscribed events and release other references and resources.
base.OnDeactivated();
}
public override void aOrderInStorageOutDeliveryNoteOutInvoice_Execute(object sender, PopupWindowShowActionExecuteEventArgs e)
{
base.aOrderInStorageOutDeliveryNoteOutInvoice_Execute(sender, e);
private void aPrintLastInvoice_Execute(object sender, SimpleActionExecuteEventArgs e)
{
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
OrderInHeader _OrderInHeader = View.SelectedObjects[0] as OrderInHeader;
XPCollection<InvoiceRows> _InvoiceRows_Collection = new XPCollection<InvoiceRows>(_ocur.Session,
CriteriaOperator.Parse("(OrderInRows.OrderInHeader = ? or OrderInRowsOther.OrderInHeader = ?) and IsNull(InvoiceHeader.GCRecord)=True and IsNull(InvoiceHeader)=False",
_OrderInHeader.Oid, _OrderInHeader.Oid));
if (_InvoiceRows_Collection.Count > 0)
{
_InvoiceRows_Collection.Sorting.Add(new SortProperty("InvoiceHeader.DateCreated", DevExpress.Xpo.DB.SortingDirection.Descending));
_InvoiceRows_Collection.Sorting.Add(new SortProperty("InvoiceHeader.DocumentNumber", DevExpress.Xpo.DB.SortingDirection.Ascending));
InvoiceHeader _InvoiceHeader = _InvoiceRows_Collection[0].InvoiceHeader;
XAFPrintHelper _XAFPrintHelper = new XAFPrintHelper(_ocur, Frame, _InvoiceHeader.InvoiceType.ReportDataV2, CriteriaOperator.Parse("InvoiceHeader.Oid = ?", _InvoiceHeader.Oid));
_XAFPrintHelper.ShowPreviewV2();
}
}
public override void InvoiceCustomization(object sender, CustomizePopupWindowParamsEventArgs e)
private void aPrintLastDeliveryNoteOut_Execute(object sender, SimpleActionExecuteEventArgs e)
{
base.InvoiceCustomization(sender, e);
}
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
OrderInHeader _OrderInHeader = View.SelectedObjects[0] as OrderInHeader;
XPCollection<DeliveryNoteOutRows> _DeliveryNoteOutRows_Collection = new XPCollection<DeliveryNoteOutRows>(_ocur.Session,
CriteriaOperator.Parse("StorageOutRowsInRows.StorageOutRows.OrderInRows.OrderInHeader.Oid = ?",_OrderInHeader.Oid));
if (_DeliveryNoteOutRows_Collection.Count>0)
{
_DeliveryNoteOutRows_Collection.Sorting.Add(new SortProperty("DeliveryNoteOutHeader.DateCreated", DevExpress.Xpo.DB.SortingDirection.Descending));
_DeliveryNoteOutRows_Collection.Sorting.Add(new SortProperty("DeliveryNoteOutHeader.DocumentNumber", DevExpress.Xpo.DB.SortingDirection.Ascending));
DeliveryNoteOutHeader _DeliveryNoteOutHeader = _DeliveryNoteOutRows_Collection[0].DeliveryNoteOutHeader;
XAFPrintHelper _XAFPrintHelper = new XAFPrintHelper(_ocur, Frame, _DeliveryNoteOutHeader.DeliveryNoteOutType.ReportDataV2, CriteriaOperator.Parse("DeliveryNoteOutHeader.Oid = ?", _DeliveryNoteOutHeader.Oid));
_XAFPrintHelper.ShowPreviewV2();
}
}
}
}