예제 #1
0
        //    public static string Get_CalculatedProperty(fmIDocCacheJournal instance) {
        //        // A "Get_" method is executed when getting a target property value. The target property should be readonly.
        //        // Use this method to implement calculated properties.
        //        return "";
        //    }
        //    public static void AfterChange_PersistentProperty(fmIDocCacheJournal 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.
        //    }
        //    public static void AfterConstruction(fmIDocCacheJournal instance) {
        //        // The "AfterConstruction" method is executed only once, after an object is created.
        //        // Use this method to initialize new objects with default property values.
        //    }
        public static fmIDocCacheJournalLine RegisterDocument(IObjectSpace os_doc, fmIDocCache doc)   //, IObjectSpace os_jur) {
        // You can also define custom methods.
        {
            fmIDocCacheJournalLine line    = os_doc.FindObject <fmIDocCacheJournalLine>(new BinaryOperator("Document", doc));
            fmIDocCacheJournal     journal = null;

            if (line != null)
            {
                return(line);
            }
            Int32 date_delimiter = 0;

            switch (doc.JournalType)
            {
            case fmIDocCacheJournalType.JOURNAL_PREPARE:
                date_delimiter = doc.DocDate.Year;
                journal        = os_doc.FindObject <fmIDocCacheJournal>(
                    CriteriaOperator.And(new BinaryOperator("JournalType", doc.JournalType),
                                         new BinaryOperator("DateDelimiter", date_delimiter)));
                if (journal == null)
                {
                    journal               = os_doc.CreateObject <fmIDocCacheJournal>();
                    journal.JournalType   = doc.JournalType;
                    journal.DateDelimiter = date_delimiter;
                }
                line = os_doc.CreateObject <fmIDocCacheJournalLine>();
                journal.Lines.Add(line);
                journal.CurrentNumber++;
                line.NumberSequence = journal.CurrentNumber;
                line.Document       = doc;
                return(line);
//                    break;
            }
            return(null);
        }
예제 #2
0
        public static void AfterConstruction(fmIDocCache 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.DocDate = DateTime.Now;
            if (crmUserParty.CurrentUserParty != null)
            {
                if (crmUserParty.CurrentUserParty.Value != null)
                {
                    instance.DocParty = crmUserParty.CurrentUserPartyGet(os).Party;
                }
            }
            csCSecurityUser user = SecuritySystem.CurrentUser as csCSecurityUser;

            user = os.GetObject <csCSecurityUser>(user);
            if (user != null && user.Staff != null)
            {
                instance.DocPartyDepartment = user.Staff.Department;
            }

            instance.AccountDebit = os.FindObject <fmCFAAccount>(
                CriteriaOperator.And(
                    new BinaryOperator("AccountSystem.Code", "1000"),
                    new BinaryOperator("BuhCode", "5011")
                    ));
            instance.AccountCredit = os.FindObject <fmCFAAccount>(
                CriteriaOperator.And(
                    new BinaryOperator("AccountSystem.Code", "1000"),
                    new BinaryOperator("BuhCode", "6242")
                    ));
            instance.AVTMode = "1";
        }
예제 #3
0
        public static String Get_SummaSeniorString(fmIDocCache instance)
        {
            // A "Get_" method is executed when getting a target property value. The target property should be readonly.
            //        // Use this method to implement calculated properties.
            Int64 val = (Int64)instance.Summa;

            return(RSDN.RusNumber.Str(val, true));
        }
예제 #4
0
 public static void AfterChange_PayPartyStaff(fmIDocCache instance)
 {
     if (instance.PayPartyStaff != null)
     {
         instance.PayPartyType = fmIDocCachePartyType.PARTY_STAFF;
         instance.UpdatePartyName();
     }
 }
예제 #5
0
        public static String Get_SummaJuniorString(fmIDocCache instance)
        {
            // A "Get_" method is executed when getting a target property value. The target property should be readonly.
            //        // Use this method to implement calculated properties.
            Int64 val = (Int64)instance.Summa;

            val = ((Int64)(instance.Summa * 100)) - val * 100;
            return(val.ToString("D2"));
        }
예제 #6
0
 public static void AfterChange_PayPartyType(fmIDocCache instance)
 {
     if (instance.PayPartyType == fmIDocCachePartyType.PARTY_STAFF)
     {
         instance.PayPartyParty = null;
     }
     if (instance.PayPartyType == fmIDocCachePartyType.PARTY_PARTY)
     {
         instance.PayPartyStaff = null;
     }
 }
예제 #7
0
 public static String Get_AnaliticCode(fmIDocCache instance)
 {
     if (instance.Lines.Count > 0)
     {
         return(instance.Lines[0].AnaliticCode);
     }
     else
     {
         return(String.Empty);
     }
 }
예제 #8
0
 public static void Set_PayPartyParty(fmIDocCache instance, crmIParty party)
 {
     if (party != null)
     {
         instance.PayPartyPartyC = party.Party;
     }
     else
     {
         instance.PayPartyPartyC = null;
     }
 }
예제 #9
0
        //public static String Get_PayPartyName(fmIDocCache instance) {
        //    // A "Get_" method is executed when getting a target property value. The target property should be readonly.
        //    // Use this method to implement calculated properties.
        //    if (instance.PayPartyParty != null)
        //        return instance.PayPartyParty.Name;
        //    else if (instance.PayPartyStaff != null)
        //        return instance.PayPartyStaff.NameFull;
        //    else
        //        return String.Empty;
        //}

        public static void UpdatePartyName(fmIDocCache instance)
        {
            // A "Get_" method is executed when getting a target property value. The target property should be readonly.
            // Use this method to implement calculated properties.
            if (instance.PayPartyParty != null)
            {
                instance.PayPartyName = instance.PayPartyParty.Name;
            }
            else if (instance.PayPartyStaff != null)
            {
                instance.PayPartyName = instance.PayPartyStaff.NameFull;
            }
            else
            {
                instance.PayPartyName = String.Empty;
            }
        }
예제 #10
0
 public static void AfterChange_PersistentProperty(fmIDocCache 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.
 }
예제 #11
0
 public static String Get_SummaString(fmIDocCache instance)
 {
     return(instance.SummaSeniorString + " руб. " + instance.SummaJuniorString + " коп.");
 }
예제 #12
0
 public static Int64 Get_SummaSenior(fmIDocCache instance)
 {
     return((Int64)instance.Summa);
 }
예제 #13
0
 public static crmIParty Get_PayPartyParty(fmIDocCache instance)
 {
     return(instance.PayPartyPartyC);
 }
예제 #14
0
 public static IList <hrmStaff> Get_GrossAccountStaffList(fmIDocCache instance, IObjectSpace os)
 {
     return(fmCSettingsFinance.GetInstance(os).ManagerGroupOfSignAccountDepartmentStaffs);
 }