protected void CreateAssociatedExpenses() { TipoGastoList tipos = TipoGastoList.GetList(false, true); Expense gasto = Gastos.NewItem(this, ECategoriaGasto.SeguroSocial); TipoGastoInfo tipo = tipos.GetItem(ModulePrincipal.GetDefaultSegurosSetting()); if (tipo.Oid == 0) { throw new iQException(Resources.Messages.NO_TIPOGASTO_SEGUROS, iQExceptionCode.INVALID_OBJECT); } gasto.OidTipo = tipo.Oid; gasto.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago); gasto = Gastos.NewItem(this, ECategoriaGasto.Impuesto); tipo = tipos.GetItem(ModulePrincipal.GetDefaultIRPFSetting()); if (tipo.Oid == 0) { throw new iQException(Resources.Messages.NO_TIPOGASTO_IRPF, iQExceptionCode.INVALID_OBJECT); } gasto.OidTipo = tipo.Oid; gasto.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago); InsertStaff(); CalculateTotal(); }