Esempio n. 1
0
        /// <summary>
        /// Konstruktor (izdaje pravna osoba za pričuvu/zgradu)
        /// </summary>
        /// <param name="legalPersonFrom">pravna osoba koja šalje račun za zgradu</param>
        /// <param name="reserve">Pričuva</param>
        /// <param name="paymentDescription">opis plaćanja</param>
        /// <param name="tax">porez/PDV</param>
        public Bill(LegalPerson legalPersonFrom, Reserve reserve, string paymentDescription, short tax)
        {
            if (String.IsNullOrEmpty(legalPersonFrom.NumberOfBankAccount)) {
                throw new BusinessRulesException("Legal Person has not valid bank account number.");
            }

            to = null;
            this.reserve = reserve;
            from = new LegalPersonSnapshot(legalPersonFrom);
            this.paymentDescription = paymentDescription;
            this.tax = tax;
            dateTimeIssued = DateTime.Now;
            isPaid = false;

            billItems = new List<BillItem>();
        }
        public static bool IssueMonthlyReserveBills(Reserve reserve, IBillsRepository billsRepository)
        {
            var currentDateTime = DateTime.Now;
            bool areIssuedReserveBillsFor = billsRepository.AreIssuedReserveBillsFor(reserve, currentDateTime.Month,
                                                                                     currentDateTime.Year);

            if(!areIssuedReserveBillsFor) {
                if(reserve.Building.LandRegistry != null && reserve.Building.LandRegistry.Locked) {
                    var partitionSpaces = reserve.Building.LandRegistry.OwnedPartitionSpaces;

                        foreach (var partitionSpace in partitionSpaces) {
                            reserve.IssueReserveBillFor(partitionSpace, 23);
                        }

                    return true;
                }
            }

            return false;
        }
Esempio n. 3
0
        /// <summary>
        /// Konstruktor (izdaje pričuva/zgrada za osobu)
        /// </summary>
        /// <param name="reserve">pričuva</param>
        /// <param name="personTo">osoba koja placa racun</param>
        /// <param name="paymentDescription">opis placanja</param>
        /// <param name="tax">porez/PDV</param>
        public Bill(Reserve reserve, Person personTo, string paymentDescription, short tax)
        {
            from = null;
            this.reserve = reserve;
            to = new PersonSnapshot(personTo);
            this.paymentDescription = paymentDescription;
            this.tax = tax;
            dateTimeIssued = DateTime.Now;
            isPaid = false;

            billItems = new List<BillItem>();
        }
Esempio n. 4
0
 /// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="buildingManager">upravitelj zrade</param>
 public Building(BuildingManager buildingManager)
 {
     SetBuildingManager(buildingManager);
     reserve = new Reserve(this);
 }