// public static int SumMethod(fmIDocCacheInRealPrepare instance, int val1, int val2) { // // You can also define custom methods. // return val1 + val2; // } public static void UpdateAVTSumma(fmIDocCacheInRealPrepare instance) { if (instance.AVTRate != null) { instance.AVTSumma = csNDSRate.getNDSBack(instance.Summa, instance.AVTRate); } }
// public static void AfterChange_Summa(fmIDocCacheInRealPrepare instance) { if (instance.AVTRate != null) { instance.UpdateAVTSumma(); // instance.AVTSumma = csNDSRate.getNDS(instance.Summa, instance.AVTRate); } }
public static void AfterConstruction(fmIDocCacheInRealPrepare instance, IObjectSpace os) { // The "AfterConstruction" method is executed only once, after an object is created. // Use this method to initialize new objects with default property values. instance.JournalType = fmIDocCacheJournalType.JOURNAL_PREPARE; instance.Status = fmIDocCacheInRealPrepareStatus.CREATED; instance.PayPartyType = fmIDocCachePartyType.PARTY_PARTY; instance.PrepareLines.Add(os.CreateObject <fmIDocCacheInRealPrepareLine>()); }
public static void AfterChange_Order(fmIDocCacheInRealPrepare instance) { // An "AfterChange_" method is executed after a target property is changed. The target property should not be readonly. // Use this method to refresh dependant property values. foreach (var line in instance.PrepareLines) { // if (line_doc.AVTRate == null) line.Order = instance.Order; } }
private void ApproveAction_Execute(object sender, SimpleActionExecuteEventArgs e) { fmIDocCacheInRealPrepare obj = e.CurrentObject as fmIDocCacheInRealPrepare; if (obj == null) { return; } this.ObjectSpace.CommitChanges(); obj.Approve(); this.ObjectSpace.CommitChanges(); }
public static void AfterChange_AVTSumma(fmIDocCacheInRealPrepare instance) { if (instance.AVTRate != null) { if (instance.AVTRate.Numerator != 0) { instance.DescriptionContent = instance.AVTRate.Name + " = " + instance.AVTSumma.ToString("N2"); } else { instance.DescriptionContent = instance.AVTRate.Name; } } }
public static void AfterChange_AVTRate(fmIDocCacheInRealPrepare instance) { // An "AfterChange_" method is executed after a target property is changed. The target property should not be readonly. // Use this method to refresh dependant property values. if (instance.AVTRate != null) { instance.UpdateAVTSumma(); // instance.AVTSumma = csNDSRate.getNDS(instance.Summa, instance.AVTRate); } foreach (var line in instance.PrepareLines) { // if (line_doc.AVTRate == null) line.AVTRate = instance.AVTRate; } }
public static void Approve(fmIDocCacheInRealPrepare instance, IObjectSpace os) { switch (instance.Status) { case fmIDocCacheInRealPrepareStatus.CREATED: fmIDocCacheJournalLine line = fmIDocCacheJournalLogic.RegisterDocument(os, instance); instance.DocNumber = line.NumberSequence.ToString("D6"); instance.Status = fmIDocCacheInRealPrepareStatus.PREPARED; break; case fmIDocCacheInRealPrepareStatus.PREPARED: break; case fmIDocCacheInRealPrepareStatus.PAYED: break; default: break; } }
//public static void OnSaving(fmIDocCacheInRealPrepare instance) { //} public static IList <fmIDocCacheLine> Get_Lines(fmIDocCacheInRealPrepare instance) { return(new ListConverter <fmIDocCacheLine, fmIDocCacheInRealPrepareLine>(instance.PrepareLines)); }