public void PayAssetMaintanceTax(Asset asset) { AssetMaintainceTaxLaw law = new AssetMaintainceTaxLaw(); int tax = law.percent * asset.value; if (money >= tax && accountBlocked == false) { MoneyTransferHistory history = new MoneyTransferHistory { sender = this, reciver = GovermentAccounts.Instance.govAccount, ID = MoneyTransferRegister.Instance.GenerateTransactionID(), money = tax, tax = tax, taxPayed = true }; history.title = "AMT MTRANSFER " + history.ID + " FOR ASSET " + asset.name + " FROM PERSON " + owner.ID; bankStatements.Add(history); history.reciver.bankStatements.Add(history); MoneyTransferRegister.Instance.transfers.Add(history); law.isVioleted = false; money -= tax; history.reciver.money += tax; } else { return; } }
public void TransferMoneyWithoutTaxes(BankAccount recieve, String reason, int money) { if (this.money >= money && this.accountBlocked == false) { this.money -= money; } else { return; } MoneyTransferHistory history = new MoneyTransferHistory { sender = this, reciver = recieve, title = reason, money = money, ID = MoneyTransferRegister.Instance.GenerateTransactionID() }; bankStatements.Add(history); recieve.bankStatements.Add(history); MoneyTransferTaxLaw law = new MoneyTransferTaxLaw(); history.tax = law.CalculateTaxes(history); history.taxPayed = false; MoneyTransferRegister.Instance.transfers.Add(history); law.isVioleted = true; crimes.Add(law); this.money -= money; recieve.money += money; }
public void TransferAssetTaxFree(AssetAccount client, BankAccount cba, BankAccount sba, int price, Asset asset) { MoneyTransferHistory history = new MoneyTransferHistory { sender = sba, reciver = cba, title = "ATRANSFER MTRANSFER FROM " + sba.owner.ID + " TO " + cba.owner.ID, money = price, ID = MoneyTransferRegister.Instance.GenerateTransactionID(), tax = 0, taxPayed = true }; sba.bankStatements.Add(history); cba.bankStatements.Add(history); AssetTransferHistory transferHistory = new AssetTransferHistory() { sender = this, reciver = client, money = price, ID = AssetTransferRegister.Instance.GenerateTransactionID(), asset = asset }; transferHistory.tax = 0; transferHistory.taxPayed = true; transferHistory.title = "ATRANSFER FROM " + owner.ID + " TO " + client.owner.ID; MoneyTransferRegister.Instance.transfers.Add(history); transferHistories.Add(transferHistory); client.transferHistories.Add(transferHistory); AssetTransferRegister.Instance.transfers.Add(transferHistory); asset.owner = client.owner; sba.money += price; cba.money -= price; }
public void TransferAssetWithTax(AssetAccount client, BankAccount cba, BankAccount sba, int price, Asset asset) { AssetTransferTaxLaw law = new AssetTransferTaxLaw(); int tax = law.CalculateTaxes(asset); if (price + tax >= cba.money && cba.accountBlocked == false && haveAccess) { if (asset.owner == this.owner) { MoneyTransferHistory history = new MoneyTransferHistory { sender = sba, reciver = cba, title = "ATRANSFER MTRANSFER FROM " + sba.owner.ID + " TO " + cba.owner.ID, money = price, ID = MoneyTransferRegister.Instance.GenerateTransactionID(), tax = 0, taxPayed = true }; sba.bankStatements.Add(history); cba.bankStatements.Add(history); MoneyTransferHistory thistory = new MoneyTransferHistory { sender = sba, reciver = GovermentAccounts.Instance.govAccount, money = price, ID = MoneyTransferRegister.Instance.GenerateTransactionID() }; AssetTransferHistory transferHistory = new AssetTransferHistory() { sender = this, reciver = client, money = price, ID = AssetTransferRegister.Instance.GenerateTransactionID(), asset = asset }; transferHistory.tax = tax; transferHistory.taxPayed = true; transferHistory.title = "ATRANSFER FROM " + owner.ID + " TO " + client.owner.ID; thistory.title = "ATT MTRANSFER" + thistory.ID + " FROM ATRANSFER " + transferHistory.ID + "FROM PERSON " + owner.ID; MoneyTransferRegister.Instance.transfers.Add(history); MoneyTransferRegister.Instance.transfers.Add(thistory); law.isVioleted = false; transferHistories.Add(transferHistory); client.transferHistories.Add(transferHistory); AssetTransferRegister.Instance.transfers.Add(transferHistory); asset.owner = client.owner; sba.money += price; cba.money -= price; } } else { return; } }
public void TransferMoneyWithTaxes(BankAccount recieve, String reason, int money) { MoneyTransferTaxLaw law = new MoneyTransferTaxLaw(); int tax = law.CalculateTaxes(money); if (money + tax <= this.money && this.accountBlocked == false) { MoneyTransferHistory history = new MoneyTransferHistory { sender = this, reciver = recieve, title = reason, money = money, ID = MoneyTransferRegister.Instance.GenerateTransactionID() }; history.tax = tax; history.taxPayed = true; MoneyTransferHistory taxHistory = new MoneyTransferHistory { sender = this, reciver = GovermentAccounts.Instance.govAccount, ID = MoneyTransferRegister.Instance.GenerateTransactionID(), money = history.tax }; taxHistory.title = "MTT MTRANSFER " + taxHistory.ID + " FROM MTRANSFER " + history.ID + " FROM PERSON " + owner.ID; bankStatements.Add(history); bankStatements.Add(taxHistory); recieve.bankStatements.Add(history); MoneyTransferRegister.Instance.transfers.Add(history); MoneyTransferRegister.Instance.transfers.Add(taxHistory); law.isVioleted = false; this.money -= (money + tax); recieve.money += (money + tax); } else { return; } }
public void TransferMoneyTaxFree(BankAccount recieve, String reason, int money) { MoneyTransferHistory history = new MoneyTransferHistory { sender = this, reciver = recieve, ID = MoneyTransferRegister.Instance.GenerateTransactionID(), money = money, tax = 0, taxPayed = true }; history.title = reason; bankStatements.Add(history); history.reciver.bankStatements.Add(history); MoneyTransferRegister.Instance.transfers.Add(history); //law.isVioleted = false; this.money -= money; history.reciver.money += money; }
public int CalculateTaxes(MoneyTransferHistory history) { return((int)this.percent * history.money); }